package com.yhb.service.impl;

import com.yhb.dao.GoodMapper;
import com.yhb.model.Good;
import com.yhb.service.GoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodServiceImpl implements GoodService {

    @Autowired
    private GoodMapper goodMapper;

    @Override
    public List<Good> getVipList() {
        return goodMapper.getGoodsOfType(Good.Type.VIP);
    }

    @Override
    public List<Good> getPrimeVipList() {
        return goodMapper.getGoodsOfType(Good.Type.PRIME);
    }

    @Override
    public Good getById(String goodId) {
        return goodMapper.goodById(goodId);
    }
}
